package service.Impl;

import dao.Impl.C_IdDaoImpl;
import model.VO.C_SetmealVO;
import model.VO.DishItemVO;
import model.VO.DishListVO;
import model.VO.SetmealInfoVO;
import model.entity.Setmeal;
import service.C_IdService;

import java.util.List;

public class C_IdServiceImpl implements C_IdService {
    C_IdDaoImpl dao=new C_IdDaoImpl();
    //按套餐id查询菜品
    @Override
    public SetmealInfoVO find(int id) {
        SetmealInfoVO setmealInfoVO = new SetmealInfoVO();
        List<DishItemVO> dishItemVOList=dao.find(id);
        setmealInfoVO.setDishItemVOList(dishItemVOList);
        Setmeal setmeal=dao.getById(id);
        setmealInfoVO.setDescription(setmeal.getDescription());
        setmealInfoVO.setImage(setmeal.getImage());
        setmealInfoVO.setName(setmeal.getName());
        setmealInfoVO.setPrice(setmeal.getPrice());
        return setmealInfoVO;
    }
    //按分类id查询套餐
    @Override
    public List<C_SetmealVO> Find(int id) {
        return dao.Find(id);
    }
    //按分类id查询菜品
    @Override
    public List<DishListVO> FIND(int id) {
        return dao.FIND(id);
    }

}
